﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Architecture;

namespace YJKStairs.CommonUnit.StairsMoreLevelUtils
{
	public class StairsMoreLevelManager
	{
		public static int GetMoreLevelStairsLevels(Stairs stairs)
		{
			int count = stairs.GetStairsRuns().Count;
			int num = 0;
			foreach (GeometryObject geometryObject in stairs.get_Geometry(new Options()))
			{
				if (geometryObject is GeometryInstance)
				{
					GeometryInstance geometryInstance = geometryObject as GeometryInstance;
					if (geometryInstance.Symbol != null && geometryInstance.Symbol is StairsRun)
					{
						num++;
					}
				}
			}
			return num / count;
		}
	}
}
